<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTeamActivitiesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('team_activities', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title', 255)->nullable();    // 活动标题
            $table->string('type')->default('SHARE'); // share分享团，bonus ...可扩展
            $table->integer('time_limit')->default(24); //成团有效期，单位 h
            $table->decimal('discount')->default(0); // 优惠价
            $table->integer('needer')->default(2); //需要成团人数
            $table->integer('goods_id');
            $table->string('goods_name', 255)->nullable();    // 活动标题
            $table->decimal('bonus')->default(0); //团长佣金
            $table->integer('sales_sum')->default(0); //统计已拼件数
            $table->integer('virtual_num')->default(0);
            $table->integer('order')->default(100);
            $table->tinyInteger('status')->default(1);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('team_activities');
    }
}
